<html>
<head><meta charset="utf-8"><title>Rust code analysis · general · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/index.html">general</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Rust.20code.20analysis.html">Rust code analysis</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="211032346"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Rust%20code%20analysis/near/211032346" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Pavel Ignatovich <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Rust.20code.20analysis.html#211032346">(Sep 23 2020 at 17:03)</a>:</h4>
<p>Hey everyone! I’m looking at what kinds of CI and how often the Rust developers use. Anyone who has Rust projects on GitHub, could you tell me whether you use any code checkers (rustfmt, clippy, anything else maybe?), how you use them (hand-run, IDE, git hooks, actions, integrations) and why you’re doing it this way and not the other way?</p>



<a name="211033825"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Rust%20code%20analysis/near/211033825" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Rust.20code.20analysis.html#211033825">(Sep 23 2020 at 17:14)</a>:</h4>
<p>sounds like a lot of effort from contributors.</p>



<a name="211033919"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Rust%20code%20analysis/near/211033919" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Rust.20code.20analysis.html#211033919">(Sep 23 2020 at 17:15)</a>:</h4>
<p>rustfmt, clippy, proptest; ide, CI</p>



<a name="211042375"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Rust%20code%20analysis/near/211042375" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Laurențiu <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Rust.20code.20analysis.html#211042375">(Sep 23 2020 at 18:19)</a>:</h4>
<p>rustfmt, sometimes clippy; hand-run, CI</p>



<a name="211074928"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Rust%20code%20analysis/near/211074928" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Noah Lev <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Rust.20code.20analysis.html#211074928">(Sep 23 2020 at 23:38)</a>:</h4>
<p>For CI, I have <code>cargo fmt -- --check</code>. I've thought of running clippy with <code>-D all</code> in CI,  but I run it locally from time to time. And I have VS Code run rustfmt on save</p>



<a name="211083656"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Rust%20code%20analysis/near/211083656" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Lokathor <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Rust.20code.20analysis.html#211083656">(Sep 24 2020 at 02:21)</a>:</h4>
<p>I use miri in some projects.<br>
I used to use rustfmt but then realized one day that it's dumb to have in CI because if the writer and reviewer both don't care about a newline out of place, why should the CI care?</p>



<a name="211083755"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Rust%20code%20analysis/near/211083755" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Noah Lev <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Rust.20code.20analysis.html#211083755">(Sep 24 2020 at 02:23)</a>:</h4>
<blockquote>
<p>I used to use rustfmt but then realized one day that it's dumb to have in CI because if the writer and reviewer both don't care about a newline out of place, why should the CI care?</p>
</blockquote>
<p>Though then when someone works on the file later and uses rustfmt they'll have diff noise.</p>



<a name="211083770"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Rust%20code%20analysis/near/211083770" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Rust.20code.20analysis.html#211083770">(Sep 24 2020 at 02:23)</a>:</h4>
<p>don't use rustfmt then <span aria-label="shrug" class="emoji emoji-1f937" role="img" title="shrug">:shrug:</span></p>



<a name="211083810"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Rust%20code%20analysis/near/211083810" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Rust.20code.20analysis.html#211083810">(Sep 24 2020 at 02:24)</a>:</h4>
<p>running rustfmt as a first PR is really rude IMO</p>



<a name="211083814"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Rust%20code%20analysis/near/211083814" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Rust.20code.20analysis.html#211083814">(Sep 24 2020 at 02:24)</a>:</h4>
<p>if the maintainer wanted to use rustfmt, they would</p>



<a name="211083820"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Rust%20code%20analysis/near/211083820" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Rust.20code.20analysis.html#211083820">(Sep 24 2020 at 02:24)</a>:</h4>
<p>(I'm biased by having a strong hate for rustfmt's style)</p>



<a name="211083847"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Rust%20code%20analysis/near/211083847" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Noah Lev <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Rust.20code.20analysis.html#211083847">(Sep 24 2020 at 02:25)</a>:</h4>
<p><span class="user-mention silent" data-user-id="232545">Joshua Nelson</span> <a href="#narrow/stream/122651-general/topic/Rust.20code.20analysis/near/211083820">said</a>:</p>
<blockquote>
<p>(I'm biased by having a strong hate for rustfmt's style)</p>
</blockquote>
<p>Hmm, really? That's funny, I mostly like it <span aria-label="smile" class="emoji emoji-1f642" role="img" title="smile">:smile:</span></p>



<a name="211083859"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Rust%20code%20analysis/near/211083859" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Rust.20code.20analysis.html#211083859">(Sep 24 2020 at 02:25)</a>:</h4>
<p>well, I don't think this is the thread for me to rant about rustfmt's style</p>



<a name="211083906"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Rust%20code%20analysis/near/211083906" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Noah Lev <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Rust.20code.20analysis.html#211083906">(Sep 24 2020 at 02:26)</a>:</h4>
<p>The only thing that bothers me is this:</p>
<div class="codehilite" data-code-language="Rust"><pre><span></span><code><span class="kd">let</span><span class="w"> </span><span class="n">foo</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">Foo</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="w">    </span><span class="n">bar</span>: <span class="s">"hello"</span><span class="p">,</span><span class="w"></span>
<span class="p">}</span><span class="w"></span>
<span class="p">.</span><span class="n">some_function</span><span class="p">();</span><span class="w"></span>
</code></pre></div>



<a name="211083916"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Rust%20code%20analysis/near/211083916" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Rust.20code.20analysis.html#211083916">(Sep 24 2020 at 02:26)</a>:</h4>
<p>that could literally be one line</p>



<a name="211083923"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Rust%20code%20analysis/near/211083923" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Rust.20code.20analysis.html#211083923">(Sep 24 2020 at 02:26)</a>:</h4>
<p><code>let foo = Foo { bar: "hello" }.some_function();</code></p>



<a name="211083960"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Rust%20code%20analysis/near/211083960" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Noah Lev <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Rust.20code.20analysis.html#211083960">(Sep 24 2020 at 02:27)</a>:</h4>
<p>Rustfmt formats that as:</p>
<div class="codehilite" data-code-language="Rust"><pre><span></span><code><span class="w">    </span><span class="kd">let</span><span class="w"> </span><span class="n">foo</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">Foo</span><span class="w"> </span><span class="p">{</span><span class="w"> </span><span class="n">bar</span>: <span class="s">"hello"</span><span class="w"> </span><span class="p">}.</span><span class="n">some_function</span><span class="p">();</span><span class="w"></span>
</code></pre></div>

<p>I meant if there were more fields.</p>



<a name="211084006"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Rust%20code%20analysis/near/211084006" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Noah Lev <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Rust.20code.20analysis.html#211084006">(Sep 24 2020 at 02:28)</a>:</h4>
<p>Like this:</p>
<div class="codehilite" data-code-language="Rust"><pre><span></span><code><span class="w">    </span><span class="kd">let</span><span class="w"> </span><span class="n">foo</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">Foo</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="w">        </span><span class="n">bar</span>: <span class="s">"hello"</span><span class="p">,</span><span class="w"></span>
<span class="w">        </span><span class="n">jdsd</span>: <span class="mi">123</span><span class="p">,</span><span class="w"></span>
<span class="w">        </span><span class="n">sjad</span>: <span class="mi">238</span><span class="p">,</span><span class="w"></span>
<span class="w">    </span><span class="p">}</span><span class="w"></span>
<span class="w">    </span><span class="p">.</span><span class="n">some_function</span><span class="p">();</span><span class="w"></span>
</code></pre></div>



<a name="211084009"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Rust%20code%20analysis/near/211084009" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Noah Lev <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Rust.20code.20analysis.html#211084009">(Sep 24 2020 at 02:28)</a>:</h4>
<p>Anyway, off-topic</p>



<a name="211084109"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Rust%20code%20analysis/near/211084109" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Lokathor <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Rust.20code.20analysis.html#211084109">(Sep 24 2020 at 02:31)</a>:</h4>
<p>All my projects use a custom rustfmt config. I still don't care about exactly following that format or about a noisy diff. None of those things matter. What matters is the code being correct, the API being easy to use, and the API being well documented.</p>



<a name="211084225"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Rust%20code%20analysis/near/211084225" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Noah Lev <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Rust.20code.20analysis.html#211084225">(Sep 24 2020 at 02:33)</a>:</h4>
<p>Of course, yes the correctness and docs etc. are most important. Noisy diffs just put more work on the reviewer.</p>



<a name="211103370"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Rust%20code%20analysis/near/211103370" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Laurențiu <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Rust.20code.20analysis.html#211103370">(Sep 24 2020 at 08:43)</a>:</h4>
<p>It's annoying to send drive-by PRs to projects that don't use <code>rustfmt</code>. "Oh, crap, the file got auto-formatted, I should undo that [or revert my changes if there's no undo]. But there were only 5 changed lines -- is it my nightly <code>rustfmt</code>? Or does the project author not use it? Maybe I just include them in the PR. Let me check the rest of the code. Okay, it's not formatted automatically, and there are at least 5 indentation styles used in the code, I guess I should use whatever is in the nearby code."</p>



<a name="211114398"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Rust%20code%20analysis/near/211114398" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Pavel Ignatovich <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Rust.20code.20analysis.html#211114398">(Sep 24 2020 at 10:47)</a>:</h4>
<p><span class="user-mention silent" data-user-id="224471">Lokathor</span> <a href="#narrow/stream/122651-general/topic/Rust.20code.20analysis/near/211083656">said</a>:</p>
<blockquote>
<p>I use miri in some projects.<br>
I used to use rustfmt but then realized one day that it's dumb to have in CI because if the writer and reviewer both don't care about a newline out of place, why should the CI care?</p>
</blockquote>
<p>Thank you! I didn't know about miri before. As I understand, it can be used only when code is covered by tests. Is it correct or untested code also will go?</p>



<a name="211114544"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Rust%20code%20analysis/near/211114544" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Laurențiu <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Rust.20code.20analysis.html#211114544">(Sep 24 2020 at 10:48)</a>:</h4>
<p>It's a kind of emulator for the Rust IR, it will only find bugs in code that runs, either in tests, or directly in the application. But it's somewhat limited wrt. OS integration and not exactly fast.</p>



<a name="211114619"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Rust%20code%20analysis/near/211114619" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Pavel Ignatovich <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Rust.20code.20analysis.html#211114619">(Sep 24 2020 at 10:49)</a>:</h4>
<p>Interesting, I thought rustfmt is a kind of a standard and is used by literally all rust developers :D</p>



<a name="211114704"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Rust%20code%20analysis/near/211114704" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Laurențiu <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Rust.20code.20analysis.html#211114704">(Sep 24 2020 at 10:50)</a>:</h4>
<p>It's a standard because it's the only choice, but some people don't like its defaults or don't use it all</p>



<a name="211115259"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Rust%20code%20analysis/near/211115259" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> James Gill <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Rust.20code.20analysis.html#211115259">(Sep 24 2020 at 10:57)</a>:</h4>
<p>Not super familiar on rustfmt (I just use it haha) but is the idea if used widely enough it keeps all rust repos universally look stylistically identical? As opposed to the prettier approach in JS where the idea is to configure it to suit your team's general consensus for a repos code style.</p>



<a name="211115268"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Rust%20code%20analysis/near/211115268" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Pavel Ignatovich <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Rust.20code.20analysis.html#211115268">(Sep 24 2020 at 10:57)</a>:</h4>
<p>Btw, you mentioned that you use clippy sometimes. Don't you use it as a part of your CI pipeline with github actions or smth?</p>



<a name="211115399"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Rust%20code%20analysis/near/211115399" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> James Gill <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Rust.20code.20analysis.html#211115399">(Sep 24 2020 at 10:58)</a>:</h4>
<p>I also get that JS has a little more <em>freedom</em> when it comes to how far you can push the style <span aria-label="grinning" class="emoji emoji-1f600" role="img" title="grinning">:grinning:</span> .</p>



<a name="211116050"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Rust%20code%20analysis/near/211116050" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Laurențiu <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Rust.20code.20analysis.html#211116050">(Sep 24 2020 at 11:05)</a>:</h4>
<p><span class="user-mention silent" data-user-id="343418">James Gill</span> <a href="#narrow/stream/122651-general/topic/Rust.20code.20analysis/near/211115259">said</a>:</p>
<blockquote>
<p>Not super familiar on rustfmt (I just use it haha) but is the idea if used widely enough it keeps all rust repos universally look stylistically identical? As opposed to the prettier approach in JS where the idea is to configure it to suit your team's general consensus for a repos code style.</p>
</blockquote>
<p>I appreciate the defaults and the idea of having a consistent style, but some people just don't like it. At least it's always there, unlike what I've seen in my (few) encounters with JS where there are a lot of linters and they change their defaults all the time, so maybe a project's CI will fail because I'm using a newer version of <code>prettier</code>.</p>



<a name="211116147"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Rust%20code%20analysis/near/211116147" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Laurențiu <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Rust.20code.20analysis.html#211116147">(Sep 24 2020 at 11:06)</a>:</h4>
<p><code>rustfmt</code> is pretty customizable, though: <a href="https://rust-lang.github.io/rustfmt/">https://rust-lang.github.io/rustfmt/</a></p>



<a name="211116297"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Rust%20code%20analysis/near/211116297" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Laurențiu <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Rust.20code.20analysis.html#211116297">(Sep 24 2020 at 11:08)</a>:</h4>
<p><span class="user-mention silent" data-user-id="345562">Pavel Ignatovich</span> <a href="#narrow/stream/122651-general/topic/Rust.20code.20analysis/near/211115268">said</a>:</p>
<blockquote>
<p>Btw, you mentioned that you use clippy sometimes. Don't you use it as a part of your CI pipeline with github actions or smth?</p>
</blockquote>
<p>No, I just run it every once in a while, if even. I guess I'm more often working on other people's projects and <code>clippy</code> is even more controversial than <code>rustfmt</code>.</p>



<a name="211116355"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Rust%20code%20analysis/near/211116355" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Laurențiu <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Rust.20code.20analysis.html#211116355">(Sep 24 2020 at 11:09)</a>:</h4>
<p>And it can be annoying for contributors: in the nightly toolchain there's often no <code>clippy</code> (also no <code>rustfmt</code>, but maybe less often) and I sometimes uninstall it to upgrade the compiler. So a nightly user might not even be able to install it.</p>



<a name="211116414"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Rust%20code%20analysis/near/211116414" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> James Gill <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Rust.20code.20analysis.html#211116414">(Sep 24 2020 at 11:10)</a>:</h4>
<p>Yeah definetely, personally I'm a big fan of customisation when it comes to linters. Mainly asking to get more info about the ethos for it, I just see it as "Here's a nice tool to use if you'd like".</p>



<a name="211116579"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Rust%20code%20analysis/near/211116579" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Pavel Ignatovich <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Rust.20code.20analysis.html#211116579">(Sep 24 2020 at 11:12)</a>:</h4>
<p><span class="user-mention silent" data-user-id="203546">Laurențiu Nicola</span> <a href="#narrow/stream/122651-general/topic/Rust.20code.20analysis/near/211116297">said</a>:</p>
<blockquote>
<p><span class="user-mention silent" data-user-id="345562">Pavel Ignatovich</span> <a href="#narrow/stream/122651-general/topic/Rust.20code.20analysis/near/211115268">said</a>:</p>
<blockquote>
<p>Btw, you mentioned that you use clippy sometimes. Don't you use it as a part of your CI pipeline with github actions or smth?</p>
</blockquote>
<p>No, I just run it every once in a while, if even. I guess I'm more often working on other people's projects and <code>clippy</code> is even more controversial than <code>rustfmt</code>.</p>
</blockquote>
<p>why do you consider it controversial? Is it because of almost every project has it's own configs?</p>



<a name="211116636"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Rust%20code%20analysis/near/211116636" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Laurențiu <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Rust.20code.20analysis.html#211116636">(Sep 24 2020 at 11:13)</a>:</h4>
<p>Because I've seen people have strong feelings about some of its lints, even those enabled by default. It's not a general truth, I guess, just my impression. And yes, if a project has a <code>clippy</code> config, someone isn't happy with the defaults.</p>



<a name="211116761"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Rust%20code%20analysis/near/211116761" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Chris Denton <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Rust.20code.20analysis.html#211116761">(Sep 24 2020 at 11:15)</a>:</h4>
<p>If clippy lints are uncontroversial then surely they should be in rustc?</p>



<a name="211116836"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Rust%20code%20analysis/near/211116836" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Laurențiu <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Rust.20code.20analysis.html#211116836">(Sep 24 2020 at 11:16)</a>:</h4>
<p>I think some of them have been migrated there, but what's even an uncontroversial lint?</p>



<a name="211117018"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Rust%20code%20analysis/near/211117018" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Pavel Ignatovich <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Rust.20code.20analysis.html#211117018">(Sep 24 2020 at 11:18)</a>:</h4>
<p><span class="user-mention silent" data-user-id="203546">Laurențiu Nicola</span> <a href="#narrow/stream/122651-general/topic/Rust.20code.20analysis/near/211116836">said</a>:</p>
<blockquote>
<p>I think some of them have been migrated there, but what's even an uncontroversial lint?</p>
</blockquote>
<p>One that detects something dangerous and scary with acceptably low false-pos? :D</p>



<a name="211117170"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Rust%20code%20analysis/near/211117170" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Laurențiu <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Rust.20code.20analysis.html#211117170">(Sep 24 2020 at 11:20)</a>:</h4>
<p>It might be an interesting (but still pointless?) exercise to crawl GitHub, looking for <code>clippy.toml</code> and <code>rustfmt.toml</code> files in valid Rust repositories, filter out the defaults, and see which settings people are changing most often.</p>



<a name="211117306"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Rust%20code%20analysis/near/211117306" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bjorn3 <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Rust.20code.20analysis.html#211117306">(Sep 24 2020 at 11:22)</a>:</h4>
<p>You can also change the clippy settings using <code>#[allow(clippy::lint_name)]</code> and <code>#[deny(clippy::lint_name)]</code>.</p>



<a name="211117334"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Rust%20code%20analysis/near/211117334" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Laurențiu <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Rust.20code.20analysis.html#211117334">(Sep 24 2020 at 11:23)</a>:</h4>
<p>Oh, right</p>



<a name="211118986"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Rust%20code%20analysis/near/211118986" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Pavel Ignatovich <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Rust.20code.20analysis.html#211118986">(Sep 24 2020 at 11:42)</a>:</h4>
<p><span class="user-mention silent" data-user-id="307537">Camelid</span> <a href="#narrow/stream/122651-general/topic/Rust.20code.20analysis/near/211074928">said</a>:</p>
<blockquote>
<p>For CI, I have <code>cargo fmt -- --check</code>. I've thought of running clippy with <code>-D all</code> in CI,  but I run it locally from time to time. And I have VS Code run rustfmt on save</p>
</blockquote>
<p>Do you develop in a team? It is hard to ensure everybody checks their contributions with Clippy or smth without  using as a part of CI pipeline.</p>



<a name="211119221"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Rust%20code%20analysis/near/211119221" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Pavel Ignatovich <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Rust.20code.20analysis.html#211119221">(Sep 24 2020 at 11:45)</a>:</h4>
<p><span class="user-mention silent" data-user-id="116155">Jake Goulding</span> <a href="#narrow/stream/122651-general/topic/Rust.20code.20analysis/near/211033919">said</a>:</p>
<blockquote>
<p>rustfmt, clippy, proptest; ide, CI</p>
</blockquote>
<p>It seems like opinions on Clippy were kinda divided :D Do you trust it enough to run automatically on a CI server?)</p>



<a name="211119750"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Rust%20code%20analysis/near/211119750" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Pavel Ignatovich <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Rust.20code.20analysis.html#211119750">(Sep 24 2020 at 11:51)</a>:</h4>
<p><span class="user-mention silent" data-user-id="232545">Joshua Nelson</span> <a href="#narrow/stream/122651-general/topic/Rust.20code.20analysis/near/211083770">said</a>:</p>
<blockquote>
<p>don't use rustfmt then <span aria-label="shrug" class="emoji emoji-1f937" role="img" title="shrug">:shrug:</span></p>
</blockquote>
<p>So you don't use formatting at all?</p>



<a name="211120165"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Rust%20code%20analysis/near/211120165" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Pavel Ignatovich <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Rust.20code.20analysis.html#211120165">(Sep 24 2020 at 11:54)</a>:</h4>
<p><span class="user-mention silent" data-user-id="343418">James Gill</span> <a href="#narrow/stream/122651-general/topic/Rust.20code.20analysis/near/211115259">said</a>:</p>
<blockquote>
<p>Not super familiar on rustfmt (I just use it haha) but is the idea if used widely enough it keeps all rust repos universally look stylistically identical? As opposed to the prettier approach in JS where the idea is to configure it to suit your team's general consensus for a repos code style.</p>
</blockquote>
<p>What are tou using then if not rustfmt?)</p>



<a name="211120559"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Rust%20code%20analysis/near/211120559" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Pavel Ignatovich <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Rust.20code.20analysis.html#211120559">(Sep 24 2020 at 11:58)</a>:</h4>
<p><span class="user-mention silent" data-user-id="260325">Chris Denton</span> <a href="#narrow/stream/122651-general/topic/Rust.20code.20analysis/near/211116761">said</a>:</p>
<blockquote>
<p>If clippy lints are uncontroversial then surely they should be in rustc?</p>
</blockquote>
<p>So you think that rustc lints should be enough for most cases?</p>



<a name="211121233"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Rust%20code%20analysis/near/211121233" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Pavel Ignatovich <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Rust.20code.20analysis.html#211121233">(Sep 24 2020 at 12:04)</a>:</h4>
<p><span class="user-mention silent" data-user-id="133247">bjorn3</span> <a href="#narrow/stream/122651-general/topic/Rust.20code.20analysis/near/211117306">said</a>:</p>
<blockquote>
<p>You can also change the clippy settings using <code>#[allow(clippy::lint_name)]</code> and <code>#[deny(clippy::lint_name)]</code>.</p>
</blockquote>
<p>Wow I see you've got a plenty of projects using clippy in CI on GH :D Do you find it really helpful in bug preventing?</p>



<a name="211121406"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Rust%20code%20analysis/near/211121406" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Eduardo Broto <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Rust.20code.20analysis.html#211121406">(Sep 24 2020 at 12:06)</a>:</h4>
<blockquote>
<p>And it can be annoying for contributors: in the nightly toolchain there's often no <code>clippy</code> (also no <code>rustfmt</code>, but maybe less often) and I sometimes uninstall it to upgrade the compiler. So a nightly user might not even be able to install it.</p>
</blockquote>
<p>Clippy should not break anymore as it's fixed in-tree (since not a long ago,  a couple months)</p>



<a name="211121463"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Rust%20code%20analysis/near/211121463" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Laurențiu <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Rust.20code.20analysis.html#211121463">(Sep 24 2020 at 12:06)</a>:</h4>
<p><span class="user-mention silent" data-user-id="279272">Eduardo Broto</span> <a href="#narrow/stream/122651-general/topic/Rust.20code.20analysis/near/211121406">said</a>:</p>
<blockquote>
<blockquote>
<p>And it can be annoying for contributors: in the nightly toolchain there's often no <code>clippy</code> (also no <code>rustfmt</code>, but maybe less often) and I sometimes uninstall it to upgrade the compiler. So a nightly user might not even be able to install it.</p>
</blockquote>
<p>Clippy should not break anymore as it's fixed in-tree (since not a long ago,  a couple months)</p>
</blockquote>
<p>Ah, I forgot about that</p>



<a name="211122493"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Rust%20code%20analysis/near/211122493" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Chris Denton <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Rust.20code.20analysis.html#211122493">(Sep 24 2020 at 12:17)</a>:</h4>
<p><span class="user-mention silent" data-user-id="345562">Pavel Ignatovich</span> <a href="#narrow/stream/122651-general/topic/Rust.20code.20analysis/near/211120559">said</a>:</p>
<blockquote>
<p><span class="user-mention silent" data-user-id="260325">Chris Denton</span> <a href="#narrow/stream/122651-general/topic/Rust.20code.20analysis/near/211116761">said</a>:</p>
<blockquote>
<p>If clippy lints are uncontroversial then surely they should be in rustc?</p>
</blockquote>
<p>So you think that rustc lints should be enough for most cases?</p>
</blockquote>
<p>Well I think they <em>should</em> be but whether or not they are in practice is a different question, if you see what I mean. Also clippy could include more domain specific lints whereas rustc tends to prefer lints be as widely applicable as possible (i.e. turning off rustc lints should be very rare whereas customizing clippy can be more common).</p>



<a name="211123497"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Rust%20code%20analysis/near/211123497" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> James Gill <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Rust.20code.20analysis.html#211123497">(Sep 24 2020 at 12:27)</a>:</h4>
<p><span class="user-mention silent" data-user-id="345562">Pavel Ignatovich</span> <a href="#narrow/stream/122651-general/topic/Rust.20code.20analysis/near/211120165">said</a>:</p>
<blockquote>
<p><span class="user-mention silent" data-user-id="343418">James Gill</span> <a href="#narrow/stream/122651-general/topic/Rust.20code.20analysis/near/211115259">said</a>:</p>
<blockquote>
<p>Not super familiar on rustfmt (I just use it haha) but is the idea if used widely enough it keeps all rust repos universally look stylistically identical? As opposed to the prettier approach in JS where the idea is to configure it to suit your team's general consensus for a repos code style.</p>
</blockquote>
<p>What are tou using then if not rustfmt?)</p>
</blockquote>
<p>Hi sorry if I was unclear, if I am linting rustfmt is my choice. I am just not super familiar with the work and ecosystem around it.</p>



<a name="211125206"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Rust%20code%20analysis/near/211125206" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Rust.20code.20analysis.html#211125206">(Sep 24 2020 at 12:43)</a>:</h4>
<blockquote>
<p>So you don't use rustfmt at all?</p>
</blockquote>
<p>Oh no I use rustfmt, I just resent it lmao</p>



<a name="211125430"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Rust%20code%20analysis/near/211125430" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Rust.20code.20analysis.html#211125430">(Sep 24 2020 at 12:45)</a>:</h4>
<p>I agree with <span class="user-mention silent" data-user-id="256759">boats</span>  in <a href="https://internals.rust-lang.org/t/experience-report-contributing-to-rust-lang-rust/12012">https://internals.rust-lang.org/t/experience-report-contributing-to-rust-lang-rust/12012</a> that the benefits it brings are not really worth the contributing roadblocks</p>



<a name="211125713"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Rust%20code%20analysis/near/211125713" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Rust.20code.20analysis.html#211125713">(Sep 24 2020 at 12:48)</a>:</h4>
<p><span class="user-mention silent" data-user-id="203546">Laurențiu Nicola</span> <a href="#narrow/stream/122651-general/topic/Rust.20code.20analysis/near/211103370">said</a>:</p>
<blockquote>
<p>It's annoying to send drive-by PRs to projects that don't use <code>rustfmt</code>. "Oh, crap, the file got auto-formatted, I should undo that [or revert my changes if there's no undo].</p>
</blockquote>
<p>I'd <em>hate</em> to have format-on-save, there's your first problem :P the lines are constantly moving around because rustfmt adds so much whitespace and you don't get to look at the diff to try and make it a little less awful</p>



<a name="211125996"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Rust%20code%20analysis/near/211125996" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Rust.20code.20analysis.html#211125996">(Sep 24 2020 at 12:50)</a>:</h4>
<blockquote>
<p>Well I think they should be but whether or not they are in practice is a different question, if you see what I mean. Also clippy could include more domain specific lints whereas rustc tends to prefer lints be as widely applicable as possible (i.e. turning off rustc lints should be very rare whereas customizing clippy can be more common).</p>
</blockquote>
<p>there's work in progress uplifting several clippy lints to rustc, most notably <a href="https://github.com/rust-lang/rust/pull/75671">https://github.com/rust-lang/rust/pull/75671</a></p>



<a name="211126006"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Rust%20code%20analysis/near/211126006" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Rust.20code.20analysis.html#211126006">(Sep 24 2020 at 12:50)</a>:</h4>
<p>I would love to have more clippy lints on by default :)</p>



<a name="211126053"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Rust%20code%20analysis/near/211126053" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Rust.20code.20analysis.html#211126053">(Sep 24 2020 at 12:51)</a>:</h4>
<p><span class="user-mention silent" data-user-id="345562">Pavel Ignatovich</span> <a href="#narrow/stream/122651-general/topic/Rust.20code.20analysis/near/211118986">said</a>:</p>
<blockquote>
<p><span class="user-mention silent" data-user-id="307537">Camelid</span> <a href="#narrow/stream/122651-general/topic/Rust.20code.20analysis/near/211074928">said</a>:</p>
<blockquote>
<p>For CI, I have <code>cargo fmt -- --check</code>. I've thought of running clippy with <code>-D all</code> in CI,  but I run it locally from time to time. And I have VS Code run rustfmt on save</p>
</blockquote>
<p>Do you develop in a team? It is hard to ensure everybody checks their contributions with Clippy or smth without  using as a part of CI pipeline.</p>
</blockquote>
<p>I'd argue this isn't something you <em>need</em> to run in a CI pipeline</p>



<a name="211126154"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Rust%20code%20analysis/near/211126154" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Rust.20code.20analysis.html#211126154">(Sep 24 2020 at 12:52)</a>:</h4>
<p>the point of CI is to make sure you don't break something: 'contributions should leave the codebase better than it was': <a href="https://github.com/tokio-rs/tokio/blob/master/CONTRIBUTING.md#reviewing-pull-requests">https://github.com/tokio-rs/tokio/blob/master/CONTRIBUTING.md#reviewing-pull-requests</a></p>



<a name="211126179"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Rust%20code%20analysis/near/211126179" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Rust.20code.20analysis.html#211126179">(Sep 24 2020 at 12:52)</a>:</h4>
<p>if it's something like 'use <code>.is_empty()</code> instead of <code>len() == 0</code>' is that really worth delaying a PR over?</p>



<a name="211126205"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Rust%20code%20analysis/near/211126205" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Rust.20code.20analysis.html#211126205">(Sep 24 2020 at 12:52)</a>:</h4>
<p>you can always fix it yourself in a follow-up, you know the codebase best</p>



<a name="211126350"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Rust%20code%20analysis/near/211126350" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Rust.20code.20analysis.html#211126350">(Sep 24 2020 at 12:54)</a>:</h4>
<p>although maybe <code>clippy::correctness</code> should be on by default, but I'd argue those should just be rustc lints in the first place</p>



<a name="211126354"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Rust%20code%20analysis/near/211126354" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Rust.20code.20analysis.html#211126354">(Sep 24 2020 at 12:54)</a>:</h4>
<p>I force push those kinds of fixes to the PR.</p>



<a name="211126388"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Rust%20code%20analysis/near/211126388" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Rust.20code.20analysis.html#211126388">(Sep 24 2020 at 12:54)</a>:</h4>
<p>ah nice, that's not a bad idea</p>



<a name="211126405"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Rust%20code%20analysis/near/211126405" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Rust.20code.20analysis.html#211126405">(Sep 24 2020 at 12:54)</a>:</h4>
<p>I've been hesitant to force-push in the past to avoid people being surprised</p>



<a name="211126423"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Rust%20code%20analysis/near/211126423" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Rust.20code.20analysis.html#211126423">(Sep 24 2020 at 12:54)</a>:</h4>
<p>I also strive for things like “every commit (not just PR) passes CI”</p>



<a name="211126452"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Rust%20code%20analysis/near/211126452" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Rust.20code.20analysis.html#211126452">(Sep 24 2020 at 12:55)</a>:</h4>
<p>So I usually have to fix something.</p>



<a name="211126509"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Rust%20code%20analysis/near/211126509" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Rust.20code.20analysis.html#211126509">(Sep 24 2020 at 12:55)</a>:</h4>
<p>I find that most of my contributors are one-offs and they don’t care about me or my projects all that much.</p>



<a name="211147454"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Rust%20code%20analysis/near/211147454" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Lokathor <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Rust.20code.20analysis.html#211147454">(Sep 24 2020 at 15:25)</a>:</h4>
<p>I also use <code>clippy</code> on a "when the mood strikes me" schedule.</p>



<a name="211171746"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Rust%20code%20analysis/near/211171746" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Noah Lev <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Rust.20code.20analysis.html#211171746">(Sep 24 2020 at 18:32)</a>:</h4>
<p><span class="user-mention silent" data-user-id="203546">Laurențiu Nicola</span> <a href="#narrow/stream/122651-general/topic/Rust.20code.20analysis/near/211116147">said</a>:</p>
<blockquote>
<p><code>rustfmt</code> is pretty customizable, though: <a href="https://rust-lang.github.io/rustfmt/">https://rust-lang.github.io/rustfmt/</a></p>
</blockquote>
<p>It is called "clippy" after all ;)</p>



<a name="211179430"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Rust%20code%20analysis/near/211179430" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> scottmcm <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Rust.20code.20analysis.html#211179430">(Sep 24 2020 at 19:34)</a>:</h4>
<p><span class="user-mention silent" data-user-id="203546">Laurențiu Nicola</span> <a href="#narrow/stream/122651-general/topic/Rust.20code.20analysis/near/211116297">said</a>:</p>
<blockquote>
<p>and <code>clippy</code> is even more controversial than <code>rustfmt</code>.</p>
</blockquote>
<p>Yeah, last time I tried it enough of the suggestions were "no thanks" that I just never ran it again.</p>
<p>I have heard that things are better lately, and there are certainly a bunch of great lints in it, though.</p>



<a name="211179543"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Rust%20code%20analysis/near/211179543" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Rust.20code.20analysis.html#211179543">(Sep 24 2020 at 19:34)</a>:</h4>
<p><span class="user-mention silent" data-user-id="232545">Joshua Nelson</span> <a href="#narrow/stream/122651-general/topic/Rust.20code.20analysis/near/211126179">said</a>:</p>
<blockquote>
<p>if it's something like 'use <code>.is_empty()</code> instead of <code>len() == 0</code>' is that really worth delaying a PR over?</p>
</blockquote>
<p>hmm, maybe there should be a <code>Len</code> trait that provides <code>is_empty()</code></p>



<a name="211179565"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Rust%20code%20analysis/near/211179565" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Rust.20code.20analysis.html#211179565">(Sep 24 2020 at 19:35)</a>:</h4>
<p>clippy suggests adding <code>is_empty()</code> if you have <code>len()</code> IIRC</p>



<a name="211180630"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Rust%20code%20analysis/near/211180630" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> scottmcm <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Rust.20code.20analysis.html#211180630">(Sep 24 2020 at 19:44)</a>:</h4>
<p>Some conversation about the right place for <code>.is_empty()</code>: <a href="https://github.com/rust-lang/rust/issues/35428#issuecomment-303639055">https://github.com/rust-lang/rust/issues/35428#issuecomment-303639055</a></p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>